<?
 session_start();
 require("connect.php");
 require("checksessionsodaubai.php");
?>
<html><!-- InstanceBegin template="/Templates/giaovientemplate.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="Javascript" src="scripts/innovaeditor.js"></script>
<link rel="stylesheet" type="text/css" href="css/engine.css" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<script language="javascript" type="text/javascript" src="js/datetimepicker.js">
</script>
</head>
<body>
<table align="center" width="938" cellpadding="0" cellspacing="1" border="0">
	<tr><td colspan="3" height="26" bgcolor="#CCCCCC">		
	<? $magiaovien=$_SESSION["username"];?>	
	<!--Menu 1-->
	<div id="tool">

	<a href="index.php">Trang chủ của trường</a>
		 | 
		<a href="hotrohoctap">Hỗ trợ học tập</a>

		 | 
		 
		<a href="lienhe.php">Liên hệ</a>
	</div>
	<!--het menu 1-->
	</td></tr>
	<tr><td colspan="3" height="34" bgcolor="#CCCCCC">	
	<div id="menuwrapper">
		<ul id="p7menubar">
			 <li><a class="trigger" href="giaovien.php?magv=<? echo $magiaovien;?>" target="_self">Trang chủ</a></li>
			  <li class="linemenus"></li>					 
		 	 <li><a class="trigger" href="trangcaclop.php" target="_self">Trang các lớp</a>	
			 <li class="linemenus"></li>					 
		 	 <li><a class="trigger" href="thongtincanhangv.php?magv=<? echo $magiaovien;?>" target="_self">Thông tin cá nhân</a>						  			 
		  <!--bat dau-->
		  	<?
				if ($_SESSION["login"]==true){
			?>
			 <li class="linemenus"></li>					 					 
					 <li><a class="trigger" href="logout.php" target="_self">Thoát</a>						
					<li class="linemenus"></li>
					<li><a class="trigger" href="logout.php" target="_self">
					<?
					$resu1=mysql_query("select * from giaovien where magv='{$magiaovien}'"); 
					$row1=mysql_fetch_array($resu1);
					echo "Xin chào : ";echo $row1["hotendem"];echo "&nbsp;";echo $row1["ten"];
					?>		
					<? }?>
					</a>			
		  <!--het-->
		</ul>
	</div>	
	</td></tr>
	<tr>
		<td width="175px" height="800" valign="top">		
		<!--menu trai-->
		<table align="center" width="100%" border="1" cellpadding="0" cellspacing="0">
		<tr><td valign="middle" height="30">
			<a href="quanlydiemkt.php?magv=<? echo $magiaovien;?>"><img src="anh/diemkt.png" height="16" width="16" border="0">&nbsp;</a><a href="quanlydiemkt.php?magv=<? echo $magiaovien;?>">Quản lý điểm kiểm tra</a>
		</td></tr>	
		<tr><td valign="middle" height="30">
			<a href="quanlydiemthi.php?magv=<? echo $magiaovien;?>"><img src="anh/diemthi.png" height="16" width="16" border="0">&nbsp;</a><a href="quanlydiemthi.php?magv=<? echo $magiaovien;?>">Quản lý điểm thi</a>
		</td></tr>	
		<tr><td valign="middle" height="30">
			<a href="thoikhoabieugv.php?magv=<? echo $magiaovien;?>"><img src="anh/thoikhoabieu.png" height="16" width="16" border="0">&nbsp;</a><a href="thoikhoabieugv.php?magv=<? echo $magiaovien;?>">Thời khóa biểu</a>
		</td></tr>	
		<?
			$resu=mysql_query("select * from lop where magvcn='{$magiaovien}'");
			if(mysql_num_rows($resu)>0){
		?>
		<!--Begin menu cua giao vien chu nhiem-->
		<tr><td valign="middle" height="30">
			<a href="quanlybaiviet.php?magv=<? echo $magiaovien;?>"><img src="anh/baiviet.png" height="16" width="16" border="0">&nbsp;</a>
			<a href="quanlybaiviet.php?magv=<? echo $magiaovien;?>">Quản lý bài viết</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="quanlyhocsinhgv.php?magv=<? echo $magiaovien;?>"><img src="anh/user.png" height="16" width="16" border="0">&nbsp;</a>
			<a href="quanlyhocsinhgv.php?magv=<? echo $magiaovien;?>">Quản lý học sinh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="quanlyphuhuynhgv.php?magv=<? echo $magiaovien;?>"><img src="anh/phuhuynh.png" height="16" width="16" border="0">&nbsp;</a>
			<a href="quanlyphuhuynhgv.php?magv=<? echo $magiaovien;?>">Quản lý phụ huynh</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="quanlyanhgv.php?magv=<? echo $magiaovien;?>"><img src="anh/album.png" height="16" width="16" border="0">&nbsp;</a>
			<a href="quanlyanhgv.php?magv=<? echo $magiaovien;?>">Quản lý ảnh upload</a>
		</td></tr>
		<tr><td valign="middle" height="30">
			<a href="quanlytailieugv.php?magv=<? echo $magiaovien;?>"><img src="anh/tailieuupload.png" height="16" width="16" border="0">&nbsp;</a>
			<a href="quanlytailieugv.php?magv=<? echo $magiaovien;?>">Quản lý tài liệu</a>
		</td></tr>
		<? }?>
		<!--End menu giao vien chu nhiem-->				
		</table>
		<!-- het menu trai-->
		</td>
		
    <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" -->
	<?
		$magv=$_SESSION["username"];
		$mamh=$_REQUEST["mamh"];		
		$mal=$_REQUEST["mal"];
		$result=mysql_query("select * from monhoc where mamh='{$mamh}'");
		$r=mysql_fetch_array($result);
		$result1=mysql_query("select * from lop where mal='{$mal}'");
		$r1=mysql_fetch_array($result1);
	?>
	<!--Begin cac thong tin moi-->
				<div class="gift_box_quatang">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="gift_quatang_infoblog">
						<h1 align="left">
							<font color="#CC3333">Quản lý điểm thi -> Thêm điểm thi môn <? echo $r["tenmh"];?> lớp <? echo $r1["tenl"];?></font>							
						</h1>																				
						<?
						$kieu=$_REQUEST["option"];
						if(($kieu=="lop")||($kieu=="")){
						?>
						<form name="f" action="themdiemthigv_action.php" method="post">
						<table align="center" cellpadding="0" cellspacing="3" border="0" width="100%">			
						<tr>
						<input type="hidden" name="lopid" id="lopid" value="<? echo $mal;?>">
						<input type="hidden" name="mhid" id="mhid" value="<? echo $mamh;?>">
						<input type="hidden" name="gvid" id="gvid" value="<? echo $mal;?>">
							<td align="left" colspan="2">Thêm điểm theo lớp
							| <a href="?option=hs&mal=<? echo $mal;?>&mamh=<? echo $mamh;?>">Thêm điểm theo từng học sinh</a></td>
						</tr>
						<tr><td height="1" bgcolor="#999999" colspan="2"></td></tr>
						<tr>
							<th align="left">Kỳ thi</th>
							<td align="left">
							<?
								$result2=mysql_query("select * from loaidiemthi order by tenld");
								if(mysql_num_rows($result2)<=0)
								{
									echo "Chưa có thông tin các kỳ học !";
								}else {
							?>
							<select name="kythi" id="kythi">
							<? while($r2=mysql_fetch_array($result2)) {?>
								<option value="<? echo $r2["mald"];?>">
									<? echo $r2["tenld"];?>
								</option>								
								<? }?>
							</select>
							<? }//end of else?>
							</td>
						</tr>
						<tr>
							<th align="left">Ngày</th>
							<td>
							<? $ngay=date("d-m-Y");?>
                     		<input name="demol1" id="demo11" type="text" size="25" value="<? echo $ngay;?>"><a href="javascript:NewCal('demo11','ddmmyyyy')"><img src="anh/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
					 		</td>
						</tr>						
						<tr><th align="left">Họ và tên</th><th align="left">Điểm</th></tr>
						<?
							$result2=mysql_query("select * from hocsinh where mal='{$mal}' order by ten");
							if(mysql_num_rows($result2)<=0)
							{
								echo "Lớp chưa có học sinh nào !";
							}else {							
							while($r2=mysql_fetch_array($result2)){					
						?>
							<tr>
								<td><? echo $r2["hotendem"];echo "&nbsp;";echo $r2["ten"];?></td>
								<td><input type="text" name="<? echo $r2["mahs"];?>"></td>
							</tr>
							<? }?>
							<TR><TD align="right"><input type="submit" name="submit" value="Thêm">							
							</TD>
							<td align="left"><input type="reset" name="reset" value="Bỏ qua"></td>
							</TR>
						<?
						 } //end of while(r2)
						?>
						</table>	
						</form>		
						<? }
						else if($kieu=="hs")	{?>
						<form name="f1" action="themdiemthigv2_action.php" method="post">
						<table align="center" cellpadding="0" cellspacing="3" border="0" width="100%">		
						<tr>
							<td align="left" colspan="2">
							<a href="?option=lop&mal=<? echo $mal;?>&mamh=<? echo $mamh;?>">Thêm điểm theo lớp</a> | Thêm điểm theo từng học sinh</td>
						</tr>
						<tr><td height="1" bgcolor="#999999" colspan="2"></td></tr>
						<tr>
						<input type="hidden" name="lopid" id="lopid" value="<? echo $mal;?>">
						<input type="hidden" name="mhid" id="mhid" value="<? echo $mamh;?>">
						<input type="hidden" name="gvid" id="gvid" value="<? echo $mal;?>">
							<th align="left">Kỳ thi</th>
							<td align="left">
							<?
								$result2=mysql_query("select * from loaidiemthi order by tenld");
								if(mysql_num_rows($result2)<=0)
								{
									echo "Chưa có thông tin các kỳ học !";
								}else {
							?>
							<select name="kythi" id="kythi">
							<? while($r2=mysql_fetch_array($result2)) {?>
								<option value="<? echo $r2["mald"];?>">
									<? echo $r2["tenld"];?>
								</option>								
								<? }?>
							</select>
							<? }//end of else?>
							</td>
						</tr>
						<tr>
							<th align="left">Ngày</th>
							<td>
							<? $ngay=date("d-m-Y");?>
                     		<input name="demol1" id="demo11" type="text" size="25" value="<? echo $ngay;?>"><a href="javascript:NewCal('demo11','ddmmyyyy')"><img src="anh/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
					 		</td>
						</tr>
						<tr><th align="left">Họ và tên</th><th align="left">Điểm</th></tr>
						<tr>							
							<td>
								<?
									$result5=mysql_query("select * from hocsinh where mal='{$mal}' order by ten");
									if(mysql_num_rows($result5)<=0){
										echo "Lớp chưa có học sinh nào !";
									}else {
									?>
									<select name="mahs" id="mahs">
									<?
										while($r5=mysql_fetch_array($result5)){
									?>
											<option value="<? echo $r5["mahs"];?>"><? echo $r5["hotendem"];echo "&nbsp;";echo $r5["ten"];?></option>
									<? }?>
									</select>
								<?	
									}
								?>
							</td>
							<td><input type="text" name="diem"></td>							
						</tr>
						<tr>
							<td align="right"><input type="submit" name="submit" value="Thêm" onClick="return kt();"></td>
							<td align="left"><input type="reset" name="reset" value="Bỏ qua"></td>
							<script language="JavaScript">
							function kt(){
								if(f1.diem.value=="")
									{
										alert("Bạn chưa nhập điểm kiểm tra !");
										f1.diem.focus();
										return false;
									};
								if(f1.diem.value<0)
									{
										alert("Điểm phải là số 0-10 !");
										f1.diem.focus();
										return false;
									}; 									
								if(f1.diem.value>10)
									{
										alert("Điểm phải là số 0-10 !");
										f1.diem.focus();
										return false;
									};  
									return true;
										}
							</script>
						</tr>
						</table>
						</form>				
						<? }?>																		 
						<div class="gift_quatang_mView">
							<span style="float:left; width:90px;"> 
							</span>
							<span style=" float: right; width:100px" >																		
			
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>
			
				</div>
				<!--End-->
					
	<!-- InstanceEndEditable --></td>
	<!--menu phai-->
	<td width="175" valign="top" align="center">
		<!--Begin-->
				<div class="panelgv">
					<div class="gift_quatang_topblog">
						<p class="gift_quatang_fl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_fl_right"><img src="anh/space.gif"></p>
					</div>
					<div class="noidungpanelgv">
						<h1 align="left">Album ảnh</h1>
						<table align="center" width="100%" cellpadding="2" cellspacing="0" border="0">
						<?
						$resu2=mysql_query("select * from albumtruong where nguoidang='{$magiaovien}' order by thoigian DESC limit 0,3");
						while($row2=mysql_fetch_array($resu2)){						
						?>	
							<tr><td class="tieude3"><a href="chitietalbumcuagiaovien.php?maalbum=<? echo $row2["maalbum"];?>">
										<img src="anh/1px.gif" height="15" width="16" border="0">
									</a>
									<a href="chitietalbumcuagiaovien.php?maalbum=<? echo $row2["maalbum"];?>">
										<?
											echo $row2["tenalbum"];
										?>
									</a>
							</td></tr>																					
						<? }?>
						<?
						$resu3=mysql_query("select * from albumlop where nguoidang='{$magiaovien}' order by thoigian DESC limit 0,3");
						while($row3=mysql_fetch_array($resu3)){						
						?>	
							<tr><td class="tieude3"><a href="chitietalbumcuagiaovien.php?maalbum=<? echo $row2["maalbum"];?>">
										<img src="anh/1px.gif" height="15" width="15" border="0">
									</a>
									<a href="chitietalbumcuagiaovien.php?maalbum=<? echo $row3["maalbum"];?>">
										<?
											echo $row3["tenalbum"];
										?>
									</a>
							</td></tr>																					
						<? }?>
						</table> 
						<div class="gift_quatang_mView">
							<span style="float:left; width:70px;">	
							<a href="tatcaalbumgv.php">
							Xem tất cả
							</a>						
							</span>
							<span style=" float: right;">														
							</span>
						</div>
					</div>
					<div class="gift_quatang_btmblog">
						<p class="gift_quatang_bl_left"><img src="anh/space.gif"></p>
						<p class="gift_quatang_bl_right"><img src="anh/space.gif"></p>
					</div>			
				</div>
	</td>		
	</tr>
	<tr><td colspan="3" align="center" valign="middle" bgcolor="#999999" height="100">Phạm Đức Đóa - Khoa CNTT - Đại học Xây Dựng</td></tr>
</table>
</body>
<!-- InstanceEnd --></html>
